package crossover;
import Operations.ValuesGenerator;
import util.GAConfig;
public class SingleRandomCrossOver extends CrossoverStrategy {

	private int crossoverPoint_1,crossoverPoint_2;
	
	@Override
	public int[] getCrossoverPoints(int individual1_Size,int individual2_Size) {
		crossoverPoint_1=0;
		crossoverPoint_2=0;
		if(individual1_Size==1 && individual2_Size==1)
			return new int[]{0,0};
		while(crossoverPoint_1==0 && crossoverPoint_2==0){
			this.crossoverPoint_1= ValuesGenerator.getRandomInt(individual1_Size);
			this.crossoverPoint_2= ValuesGenerator.getRandomInt(individual2_Size);
		}
		return new int[] { this.crossoverPoint_1,this.crossoverPoint_2 };
	}

	@Override
	public boolean getCrossoverFlag() {
		return true;
	}
}
